<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function test01(str){
				var regexp01 = /白/ig;
				//var regexp02 = /./ig;
				var  arrs = str.match(regexp01);
				for(var i in arrs)
				{
					document.write(arrs[i]+'<br/>');
				}
			}
			
			
			function  test02(str){
				var reg = new RegExp(' ','ig');
				var str1 = str.replace(reg,'');
				document.write(str1+'<br/>');
			}
			
			function test03(){
				var  pattern = /box/ig;
				var  str = 'This is a Box!，That is a Box too';	
				alert(str.search(pattern));	//查找到返回位置，否则返回-1

			}
			
			function test04(){
				var  pattern = / /ig;
				var  str = 'This is a Box!，That is a Box too';
				alert(str.split(pattern));		//将空格拆开分组成数组

			}
			
			function test05(){
				var  pattern = /^...$/ig;
				var str = '我试试';
				var a = pattern.test(str);
				alert(a);
			}
			
			function test06(str){
				var pattern = /^1[3|5|6|7|8]\d{9}$/ig;
				alert(pattern.test(str));
			}
			
			//test01('我是小白,你白不白!!!!');
			//test02('  水电费水电费  是的发生的 asasd 123 !!!');
			//test03();
			//test04();
			//test05();
			test06('12172387810');
		</script>
	</head>
	<body>
	</body>
</html>
